package cn.wolfcode.luowowo.article.mapper;

import cn.wolfcode.luowowo.article.domain.Travel;
import cn.wolfcode.luowowo.article.query.TravelQuery;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface TravelMapper {
    int deleteByPrimaryKey(Long id);

    int insert(Travel record);

    Travel selectByPrimaryKey(Long id);

    List<Travel> selectAll();

    int updateByPrimaryKey(Travel record);

    List<Travel> selectForList(TravelQuery qo);

    List<Travel> selectViewNumTop3ByDestId(@Param("destId") Long destId, @Param("travelId") Long travelId);

    void updateState(@Param("id") Long id, @Param("state") Integer state);


    List<Travel> selectTravelTop3ByUserId(Long id);

    List<Travel> selectTravelsByUserId(Long userId);

    void insertFavorRelation(@Param("sid") Long sid, @Param("userId") Long userId);

    void deleteUserFavor(@Param("userId") Long userId, @Param("sid") Long sid);
}